<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title>风味-确认密码</title>
		<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
		<link rel="stylesheet" type="text/css" href="css/personCenterPublic.css"/>
		<script src="js/jquery-2.1.0.js"></script>
		<style type="text/css">
			input{width: 100%;height: 50px;background: white;border: 1px solid #FFCC33;}
			input:focus{outline: none;}
			form{margin-top: 50%;}
			input[type='button']{border: none;background: #FFCC33;color: white;font-family: "微软雅黑";font-size: 16px;margin-top: 10px;letter-spacing: 5px;}
			#forget{position: relative;left: 80%;top: 20px;}
		</style>
		<script>
			$(function(){
				var str=location.href; //获取本页url地址
				var arr=str.split("?");
				var str1 = arr[1];
				var userIdString = str1.split("=")[1];
				var userId = parseInt(userIdString);
				$("#submitPsw").click(function(){
					var originPwd = $("input[name = 'originPwd']").val();
					$.ajax("/fengwei/user/setNameAndPhone",{
						type:"post",
						data:{
							'userId':userId
						},
						success:function(data){
							var userObj = eval('('+data+')');
//							判断密码是否相符
							if(userObj.userPassword==originPwd){
								alert("跳转页面");
								window.location.href = "alterPwd.html?userId="+userId+"";
							}else{
								alert("提醒密码不符")
							}
						},
						error:function(){
							alert(0)
						}

					})
				})
			})
		</script>
	</head>
	<body>
			<div id="back">
			<a href="#" onClick="javascript :history.back(-1);"><&nbsp;返回个人资料</a>
		</div>
	<form action="" method="post">	<!--确认原始密码是否正确，判断是否本人操作，如果是本人操作就予以修改密码，如果不是则要求重新输入-->
				<input type="password" name="originPwd" id="originPwd" placeholder="请输入原始密码" />
			<input type="button" id="submitPsw" value="确认原始密码"/>
		</form>
		<a href="forgetpwd.html" id="forget">忘记密码></a><!--跳转到登录时忘记密码的找回密码处-->
		<script type="text/javascript">
//		<!-- hbl---- 删掉了原来打开新窗口的方法，在提交按钮添加id属性-->
		</script>
	</body>
</html>
